Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT]- Elizabeth/cord poc #605

Closed
wants to merge 3 commits into from
Closed

[DRAFT]- Elizabeth/cord poc #605

wants to merge 3 commits into from

Conversation

eschutho
Copy link
Member

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

class MessageThread(Model):
table_name = "message_threads"
id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey("ab_user.id"), nullable=False)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
user_id = Column(Integer, ForeignKey("ab_user.id"), nullable=False)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 65.94% and project coverage change: -10.39% ⚠️

Comparison is base (3630d68) 68.89% compared to head (7ce6542) 58.50%.
Report is 77 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #605       +/-   ##
===========================================
- Coverage   68.89%   58.50%   -10.39%     
===========================================
  Files        1906     1909        +3     
  Lines       74628    74762      +134     
  Branches     8208     8206        -2     
===========================================
- Hits        51412    43742     -7670     
- Misses      21086    28891     +7805     
+ Partials     2130     2129        -1     
Flag Coverage Δ
hive 53.82% <65.94%> (+0.04%) ⬆️
mysql ?
postgres ?
presto 53.72% <65.94%> (+0.04%) ⬆️
python 61.29% <65.94%> (-21.59%) ⬇️
sqlite ?
unit 55.12% <65.94%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...dashboard/components/SliceHeaderControls/index.tsx 71.57% <ø> (+1.17%) ⬆️
...rontend/src/dashboard/containers/DashboardPage.tsx 8.69% <ø> (ø)
superset/message_threads/commands/create.py 44.00% <44.00%> (ø)
superset/dashboards/api.py 50.61% <47.05%> (-42.00%) ⬇️
superset/daos/thread.py 70.73% <70.73%> (ø)
superset/message_threads/models.py 72.22% <72.22%> (ø)
superset/message_threads/api.py 80.00% <80.00%> (ø)
superset/initialization/__init__.py 91.15% <100.00%> (+0.05%) ⬆️

... and 293 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

op.create_table(
"message_threads",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("user_id", sa.Integer(), nullable=False),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sa.Column("user_id", sa.Integer(), nullable=False),

chart_id=self._chart_id,
dashboard_id=self._dashboard_id,
)
return thread
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may need to return a flag if this is new so that the client side knows to generate a new thread on the cord side.

@@ -373,6 +424,29 @@ const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => {
? t('Exit fullscreen')
: t('Enter fullscreen');

const [threadListId, setthreadListId] = useState<string | null>(null);
const [threadIsOpen, setThreadIsOpen] = useState<boolean>(false);
const [selectedThreadID, setSelectedThreadID] = useState<string | null>(null);
Copy link
Member Author

@eschutho eschutho Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kgabryje I had originally intended for this UUID to be for a thread, not a threadList, so that's why the naming is a bit wonky.

default=lambda o: {key: value for key, value in o.__dict__.items() if value},
indent=4,
allow_nan=False,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the above code is all from Cord's python sdk file. We may not need it, but I left it here in case you wanted it for anything.

# the existing auth_token if it exists
return get_client_auth_token(
app_id="<todo>",
secret="<todo>",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want to update this on your local implementation.

user_uuid = Column(String(255), nullable=False, default=uuid.uuid4)
expires_at = Column(Integer, nullable=False)

def __init__(self, user_id, workspace_name, auth_token, expires_at, user_uuid):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't persist to the db, but is used in just setting up an instance of the model for the api

logger = logging.getLogger(__name__)


class MessageThreadDAO(BaseDAO[MessageThread]):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these MessageThreads are actually all going to be ThreadList components now.. this was my earlier naming. @Antonio-RiveroMartnez


# not sure if we also need this check
dashboard = (
db.session.query(Dashboard).filter(Dashboard.id == dashboard_id).first()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per the discussion, not sure if we want to persist this or not.

dashboard_id = Column(Integer, ForeignKey("dashboards.id"), nullable=True)
chart_id = Column(Integer, ForeignKey("slices.id"), nullable=True)
uuid = Column(String(36), unique=True, nullable=False, default=uuid.uuid4)
workspace_name = Column(String(255), nullable=False)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need workspace name any more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants